# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
pkgname=kopeninghours
pkgver=23.08.4
pkgrel=0
pkgdesc="Library for parsing and evaluating OSM opening hours expressions"
url="https://invent.kde.org/libraries/kopeninghours"
# armhf blocked by extra-cmake-modules
arch="all !armhf"
license="BSD-3-Clause AND CC0-1.0 AND LGPL-2.0-or-later"
makedepends="
	bison
	doxygen
	extra-cmake-modules
	flex
	graphviz
	kholidays5-dev
	ki18n5-dev
	qt5-qtbase-dev
	qt5-qttools-dev
	samurai
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
_repo_url="https://invent.kde.org/libraries/kopeninghours.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kopeninghours-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	cd build

	# evaluatetest and iterationtest are broken
	CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "(evaluate|iteration)test"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
76b4b46fc9bc0541636bf53aefc85bd24ecdbd243baafafc13da847281293a780410e1000930d805b710b3828234ab35b91369c5b70f86e7bdc21dff7d8c70d7  kopeninghours-23.08.4.tar.xz
"
